#include "yuv.h"

Yuv::Yuv(QRgb rgb)
{
    int red = qRed(rgb);
    int green = qGreen(rgb);
    int blue = qBlue(rgb);

    Y = 0.299*red + 0.587*green + 0.114*blue;
    U = -0.147*red - 0.289*green + 0.436*blue;
    V = 0.615*red - 0.515*green - 0.100*blue;

}

float Yuv::getY(){
    return Y;
}

float Yuv::getU(){
    return U;
}

float Yuv::getV(){
    return V;
}
